package chap3_9;

public class Exer3_9_8 {
    public static void main(String[] args) {
        int j = 1;
        int count = 0;
        for (int i = 2; i < 10000; i++) {
            if (i == 2) {
                System.out.print(i+",");
                count++;
            }
            for (j = 2; j * j < i; j++) {
                if (i % j == 0) {
                    break;
                }
            }
            if (i % j != 0) {
                System.out.print(i+",");
                count++;
            }

        }
        System.out.println();
        System.out.println("1到10000内质数的个数一共为" + count+"个");
    }
}
